<%-- 
    Document   : detailPenelitian
    Created on : Oct 6, 2012, 2:04:54 PM
    Author     : user
--%>

<%@page import="Entity.PenelitiEksternal"%>
<%@page import="Entity.MahasiswaPeneliti"%>
<%@page import="Entity.DosenPeneliti"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@include file="../header.jsp"%>
<!DOCTYPE html>
<!-- start content-outer -->
<div id="content-outer"><!-- start content -->
    <div id="content">
        <div id="page-heading">
            <h1>Detail Penelitian</h1>
        </div>
        <table id="content-table" border="0" cellpadding="0" cellspacing="0" width="100%">
            <tbody>
                <tr>
                    <th rowspan="3" class="sized"><img src="images/shared/side_shadowleft.jpg" alt="" height="300" width="20" /></th>
                    <th class="topleft"></th>
                    <td id="tbl-border-top">&nbsp;</td>
                    <th class="topright"></th>
                    <th rowspan="3" class="sized"><img src="images/shared/side_shadowright.jpg" alt="" height="300" width="20" /></th>
                </tr>
                <tr>
                    <td id="tbl-border-left"></td>
                    <td><!-- start content-table-inner -->
                        <div id="content-table-inner">
                            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                <tbody>
                                    <tr valign="top">
                                        <td>
                                            <!-- start step-holder -->

                                            <!-- end step-holder -->

                                            <!-- start id-form -->
                                            <table id="id-detail" border="0" cellpadding="0" cellspacing="0" width="100%">
                                                <tbody>
                                                    <tr>
                                                        <th width="300" valign="top">Judul Penelitian</th>
                                                        <td width="29" valign="middle" align="center">:</td>
                                                        <td width="500">${penelitian.judulPenelitian}</td>
                                                        <td></td>
                                                    </tr>
                                                    <tr>
                                                        <th valign="top">Dana yang Diterima</th>
                                                        <td valign="middle" align="center">:</td>
                                                        <td><fmt:formatNumber value="${penelitian.danaDiterima}" type="currency" currencyCode="IDR"/></td>
                                                        <td></td>
                                                    </tr>
                                                    <tr>
                                                        <th valign="top">Sumber Penadanaan / Program Pendanaan</th>
                                                        <td valign="middle" align="center">:</td>        
                                                        <td>${penelitian.sumberDana.sumberPendanaan}</td>
                                                        <td></td>
                                                    </tr>
                                                    <tr>
                                                        <th valign="top">Tanggal Pelaksanaan</th>
                                                        <td valign="middle" align="center">:</td>
                                                        <td><c:set var="now" value="<%=new java.util.Date()%>" />
                                                            <fmt:parseDate value="${penelitian.tanggalPenelitianDimulai}" var="parsedTanggalMulai" pattern="yyyy-MM-dd" />
                                                            <fmt:formatDate type="date" dateStyle="long" value="${parsedTanggalMulai}"/> 
                                                            s.d 
                                                            <fmt:parseDate value="${penelitian.tanggalPenelitianSelesai}" var="parsedTanggalSelesai" pattern="yyyy-MM-dd" />
                                                            <fmt:formatDate type="date" dateStyle="long" value="${parsedTanggalSelesai}"/> 
                                                        </td>
                                                        <td></td>
                                                    </tr>
                                                    <tr>
                                                        <th valign="top">Laporan Penelitian</th>
                                                        <td valign="middle" align="center">:</td>
                                                        <td><c:if test="${(penelitian.lampiranLaporan == null)}">
                                                                <label> -- </label>
                                                            </c:if>
                                                            <c:if test="${(penelitian.lampiranLaporan != null)}">
                                                                <a href="downloadFile?fileLapPenelitian=${penelitian.lampiranLaporan}">${penelitian.lampiranLaporan}</a>
                                                            </c:if> 
                                                        </td>
                                                        <td></td>
                                                    </tr>
                                                    <tr>
                                                        <th valign="top">Ketua Tim Penelitian</th>
                                                        <td valign="middle" align="center">:</td>
                                                        <td>${penelitian.ketuaPeneliti}</td>
                                                        <td></td>
                                                    </tr>
                                                    <tr>
                                                        <th valign="top">Anggota Tim Dosen</th>
                                                        <td valign="top" align="center">:</td>
                                                        <%
                                                            ArrayList<DosenPeneliti> dosenPeneliti = new ArrayList();
                                                            dosenPeneliti = (ArrayList) request.getAttribute("listDosenPeneliti");
                                                            if (dosenPeneliti.size() > 0) {
                                                        %>
                                                        <td>
                                                            <table>

                                                                <c:forEach items="${listDosenPeneliti}" var="listDosenPeneliti">
                                                                    <tr>
                                                                        <td>${listDosenPeneliti.dosen.user.namaUser}, NIP : ${listDosenPeneliti.dosen.user.idUser}</td>
                                                                        <td>&nbsp;</td>
                                                                        <td>
                                                                            <%
                                                                                ArrayList listRole3 = new ArrayList();
                                                                                listRole3 = (ArrayList) session.getAttribute("role");
                                                                                int count3;
                                                                                String role3;

                                                                                for (count3 = 0; count3 < listRole3.size(); count3++) {
                                                                                    role3 = (String) listRole3.get(count3);
                                                                                    if (role3.equals("dosen")) {
                                                                            %>  
                                                                            <c:if test="${(penelitian.idKetuaPeneliti == idUser && penelitian.statusPenelitian != '1')}">     
                                                                                <a href="hapusAnggotaTimDosen?noPenelitian=${penelitian.noPenelitian}&&idUser=${listDosenPeneliti.dosen.user.idUser}" onClick="return confirm('Apakah anda yakin untuk menghapus?')"><img src="images/shared/b_drop.png" title="hapus"/></a>
                                                                                </c:if>    
                                                                                <%  }
                                                                                    }%>
                                                                        </td>
                                                                    </tr>
                                                                </c:forEach>
                                                            </table>
                                                        </td>
                                                        <% } else {%>
                                                        <td><label>Tim Dosen Peneliti Belum Terdata</label></td>
                                                        <% }%>
                                                        <td></td>
                                                    </tr>
                                                    <%
                                                        ArrayList listRole3 = new ArrayList();
                                                        listRole3 = (ArrayList) session.getAttribute("role");
                                                        int count3;
                                                        String role3;

                                                        for (count3 = 0; count3 < listRole3.size(); count3++) {
                                                            role3 = (String) listRole3.get(count3);
                                                            if (role3.equals("dosen")) {
                                                    %>
                                                    <c:if test="${(penelitian.idKetuaPeneliti == idUser && penelitian.statusPenelitian != '1')}"> 
                                                        <tr>
                                                            <td valign="top"></td>
                                                            <td valign="middle" align="center"></td>
                                                            <td><a href="tambahAnggotaTimDosen?noPenelitian=${penelitian.noPenelitian}">[Tambah tim dosen peneliti]</a></td>
                                                            <td></td>
                                                        </tr>
                                                    </c:if>
                                                    <% }
                                                        }%>
                                                    <tr>
                                                        <th valign="top">Anggota Peneliti Eksternal</th>
                                                        <td valign="top" align="center">:</td>
                                                        <%
                                                            ArrayList<PenelitiEksternal> penelitiEks = new ArrayList();
                                                            penelitiEks = (ArrayList) request.getAttribute("listPenelitiEks");
                                                            if (penelitiEks.size() > 0) {
                                                        %>
                                                        <td>
                                                            <table>

                                                                <c:forEach items="${listPenelitiEks}" var="listPenelitiEks">
                                                                    <tr>
                                                                        <td>${listPenelitiEks.namaPeneliti}</td>
                                                                        <td>&nbsp;</td>
                                                                        <td>
                                                                            <%
                                                                                for (count3 = 0; count3 < listRole3.size(); count3++) {
                                                                                    role3 = (String) listRole3.get(count3);
                                                                                    if (role3.equals("dosen")) {
                                                                            %>  
                                                                            <c:if test="${(penelitian.idKetuaPeneliti == idUser && penelitian.statusPenelitian != '1')}">     
                                                                                <a href="hapusPenelitiEksternal?noPenelitian=${penelitian.noPenelitian}&&idPeneliti=${listPenelitiEks.idPenelitiEksternal}" onClick="return confirm('Apakah anda yakin untuk menghapus?')"><img src="images/shared/b_drop.png" title="hapus"/></a>
                                                                                </c:if>    
                                                                                <%  }
                                                                                    }%>
                                                                        </td>
                                                                    </tr>
                                                                </c:forEach>
                                                            </table>
                                                        </td>                                                        
                                                        <% } else {%>
                                                        <td><label>Tim Peneliti Eksternal Tidak Ada</label></td>
                                                        <% }%>
                                                        <td></td>
                                                    </tr>
                                                    <%

                                                        for (count3 = 0; count3 < listRole3.size(); count3++) {
                                                            role3 = (String) listRole3.get(count3);
                                                            if (role3.equals("dosen")) {
                                                    %>
                                                    <c:if test="${(penelitian.idKetuaPeneliti == idUser && penelitian.statusPenelitian != '1')}"> 
                                                        <tr>
                                                            <td valign="top"></td>
                                                            <td valign="middle" align="center"></td>
                                                            <td><a href="tambahPenelitiEksternal?noPenelitian=${penelitian.noPenelitian}">[Tambah anggota peneliti eksternal]</a></td>
                                                            <td></td>
                                                        </tr>
                                                    </c:if>
                                                    <%         }
                                                            }
                                                    %>
                                                    <tr>
                                                        <th valign="top">Anggota Tim Mahasiswa</th>
                                                        <td valign="top" align="center">:</td>
                                                        <%
                                                            ArrayList<MahasiswaPeneliti> mhsPeneliti = new ArrayList();
                                                            mhsPeneliti = (ArrayList) request.getAttribute("listMhsPeneliti");
                                                            if (mhsPeneliti.size() > 0) {
                                                        %>
                                                        <td>
                                                            <table>

                                                                <c:forEach items="${listMhsPeneliti}" var="listMhsPeneliti">
                                                                    <tr>
                                                                        <td>${listMhsPeneliti.namaMahasiswa} (${listMhsPeneliti.nrpMahasiswa}), Judul Tugas Akhir : ${listMhsPeneliti.judulTugasAkhir}</td>
                                                                        <td>&nbsp;</td>
                                                                        <td>
                                                                            <%


                                                                                for (count3 = 0; count3 < listRole3.size(); count3++) {
                                                                                    role3 = (String) listRole3.get(count3);
                                                                                    if (role3.equals("dosen")) {
                                                                            %>  
                                                                            <c:if test="${(penelitian.idKetuaPeneliti == idUser && penelitian.statusPenelitian != '1')}"> 
                                                                                <a href="hapusAnggotaTimMahasiswa?noPenelitian=${penelitian.noPenelitian}&&idAnggota=${listMhsPeneliti.idMahasiswaPeneliti}" onClick="return confirm('Apakah anda yakin untuk menghapus?')"><img src="images/shared/b_drop.png" title="hapus"/></a></td>
                                                                                </c:if>    
                                                                                <% }
                                                                                    }%>
                                                                    </tr>
                                                                </c:forEach>
                                                            </table>
                                                        </td>

                                                        <% } else {%>
                                                        <td><label>Tim Mahasiswa Belum Terdata</label></td>
                                                        <% }%>
                                                        <td></td>
                                                    </tr>
                                                    <%
                                                        for (count3 = 0; count3 < listRole3.size(); count3++) {
                                                            role3 = (String) listRole3.get(count3);
                                                            if (role3.equals("dosen")) {
                                                    %>
                                                    <c:if test="${(penelitian.idKetuaPeneliti == idUser && penelitian.statusPenelitian != '1')}"> 
                                                        <tr>
                                                            <td valign="top"></td>
                                                            <td valign="middle" align="center"></td>
                                                            <td><a href="tambahAnggotaTimMahasiswa?noPenelitian=${penelitian.noPenelitian}">[Tambah mahasiswa anggota penelitian]</a></td>
                                                            <td></td>
                                                        </tr>
                                                    </c:if>
                                                    <% }
                                                        }%>
                                                    <c:if test="${(penelitian.statusPenelitian == '2')}">                                                                 
                                                        <tr>
                                                            <th width="300" valign="top">Revisi</th>
                                                            <td width="29" valign="middle" align="center">:</td>
                                                            <td width="500">${penelitian.isiRevisi}</td>
                                                            <td></td>
                                                        </tr>
                                                    </c:if>
                                                </tbody>
                                            </table>
                                            <!-- end id-form --> </td>
                                        <td><!-- start related-activities --><!-- end related-activities --></td>
                                    </tr>
                                    <tr>
                                        <td><img src="../images/shared/blank.gif" alt="blank" height="1" width="695" /></td>
                                        <td></td>
                                    </tr>
                                </tbody>
                            </table>
                            <div class="clear"></div>
                        </div>
                        <!-- end content-table-inner -->
                    </td>
                    <td id="tbl-border-right"></td>
                </tr>
                <tr>
                    <th class="sized bottomleft"></th>
                    <td id="tbl-border-bottom">&nbsp;</td>
                    <th class="sized bottomright"></th>
                </tr>
            </tbody>
        </table>
        <div class="clear">&nbsp;</div>
    </div>
    <!-- end content -->
    <div class="clear">&nbsp;</div>
</div>
<!-- end content-outer -->
<div class="clear">&nbsp;</div>
<%@include file="../footer.jsp"%>

